#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) {
    ui->setupUi(this);
    scene = new QGraphicsScene();
    ui->graphicsView->setScene(scene);
    scene->addItem(&monGr);
}

MainWindow::~MainWindow(){
    delete ui;
}

void MainWindow::changeEvent(QEvent *e){
    QMainWindow::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void MainWindow::on_pushButton_clicked(){
    //Je demande a mon graph de passer a l'étape suivante;
    monGr.nextStep();
    //Je rafraichie mon visuel
    //ui->graphicsView->repaint();
    ui->graphicsView->hide();
    ui->graphicsView->show();
}

